#{extends 'head.html' /} 
#{set title:'蓝莲花 | 图书列表' /} 
<link rel="stylesheet" href="/public/stylesheets/alert.css" type="text/css"></link>
<script type="text/javascript" src="/public/javascripts/adu.alert.js"></script>
${(service.AdsService.get("booklistadv",1)).raw() }
	<!-- content 开始-->
    <div class="cont">
    	<!-- list 左 -->
        <div class="list_1">
        	<!-- 一 -->
            <div class="cn_a_1">
            	<div class="ca_1a"><img src="/public/indexFile/images/images_17.gif"/></div>
                <div class="ca_1b">
                	#{list bookTypes , as:"bookType"}
                	<div class="ca_1b_1">
                    	<div class="ca_bm1">
                        	<div class="cbm_a">${bookType.botName}</div>
                        	<div class="cbm_b"><a href="/books.html${bookType.fid == null ?  "" : "?id="+bookType.fid}">后退&lt;&lt;</a></div>
                        </div>
                        <div class="ca_bm2">
                        	<ul>
                        		#{list bookType.sTypes , as:"st"}
                            		<li><a href="/books.html?id=${st.id }">${st.botName}</a></li>
                                #{/list}
                            </ul>
                        </div>
                    </div>
                   #{/list} 
                </div>
            </div>
            
            <!-- 二 -->
            <div class="cn_li">
                <div class="cnb_b">
                    <div class="cnb_a1">
                        <div class="cn_a1_1">借阅榜</div>
                        <div class="cn_a1_2"><a href="#"><img src="/public/indexFile/images/images_41.gif"/></a></div>
                    </div>
                    <div class="cnb_a2 cnb_m">
                        <ul id="vn">
                        	#{set i:1 /}
                            #{list brooBook ,as :"ens"}
	                            	#{if i == 1}
                        			<li id="v${i}" class="ma" onmouseover="menv(${i})">
		                            	<div class="cv1" id="va${i}">${i}</div>
		                                <div class="cn_ba_2" id="vb${i}" style="display:none;">[修真]</div>
		                                <div class="cv3" id="vc${i}"><a href="#">&lt;&lt;${util.Util.sub(ens.booName, 6)}&gt;&gt;</a></div>
	                            	#{/if}
									#{else}
									<li id="v${i}" class="mv" onmouseover="menv(${i})">
		                            	<div class="cn_ba_1 cn_ba_x" id="va${i}">${i}</div>
		                                <div class="cn_ba_2" id="vb${i}" style="display:block;">[修真]</div>
		                                <div class="cn_ba_3" id="vc${i}"><a href="#">&lt;&lt;${util.Util.sub(ens.booName, 6)}&gt;&gt;</a></div>
	                            	#{/else}
	                            </li>
                            	#{set i:i+1 /}
                            #{/list}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- list 右 -->
        <div class="list_2">
        	<!-- 一 -->
            <div class="cn_a_r1">
                <div class="cr1_n"><select><option>书籍名字</option></select></div>
                <div class="cr1_x"><input type="text"/></div>
                <div class="cr1_v"><a href="#"><img src="/public/indexFile/images/images_19.gif"/></a></div>
                <div class="cr1_m">
                    <ul>
                        <li class="mvn">热门搜索：</li>
                        <li><a href="#">微微书香</a></li>
                        <li><a href="#">微微书香</a></li>
                        <li><a href="#">微微书香</a></li>
                        <li><a href="#">微微书香</a></li>
                    </ul>
                </div>
            </div>
            
            <!-- 二 -->
            <div class="lt_b">
                <div class="el_c2_a1">
                	<ul>
                    	<li class="ae1">您当前位置：</li>
                        <li class="ae2"><a href="/">首页</a></li>
                        <li>图书</li>
                    </ul>
                </div>
                 <div class="lt_b2"></div>
            </div>
            
            <!-- 三 -->
            <div class="lt_c">
            	<!--排序方式-->
            	<div class="lt_c1">
                	<ul>
                    	<li>排序：</li>
                        <li><a href="" order="desc" sel="0"><img src="/public/indexFile/images/list_16.gif"/></a></li>
                        <li><a href="" order="desc" sel="0"><img src="/public/indexFile/images/list_17.gif"/></a></li>
                        <li><a href="" order="desc" sel="0"><img src="/public/indexFile/images/list_18.gif"/></a></li>
                        <li><a href="" order="desc" sel="0"><img src="/public/indexFile/images/list_19.gif"/></a></li>
                        <li><a href="" order="desc" sel="0"><img src="/public/indexFile/images/list_20.gif"/></a></li>
                    </ul>
                </div>
                
                <!--内容-->
                <div class="lt_c2">
                	<ul>
                		#{list books,as:'boo'}
                    	<li>
                        	<div class="li_bl">
                        		<a href="/show_${boo.id}_book.html" style="display: block;">
                        			<img src="${boo.simage }" alt="${boo.booName }"/></a>
                        		</div>
                            <div class="li_br">
                            	<div class="li_br_1">
                            		<a href="/show_${boo.id}_book.html">${boo.booName }</a>
                            	</div>
                                <div class="li_br_2">
                                	<div style="overflow: hidden;line-height: 12px;background: url('/public/indexFile/images/list_10.gif') no-repeat;float: left;height: 12px;margin-top: 2px;width: 60px;">
                                		<div style="background: url('/public/indexFile/images/list_09.gif');height: 12px;width: ${service.BookService.pinXingJi(boo.id) }px;line-height:12px;">
                                		</div>
                                	</div>
                                    <samp>(<span>${boo.booPin }</span>条评价)</samp>
                                </div>
                                <div class="li_br_3">${service.BookService.getAuthor(boo.id)?.autrName}<span>主编</span>
                                	</div>
                                <div class="li_br_4">${boo.booDet }</div>
                                <div class="li_br_5">
                                	<div class="libr_1" style="display: none">￥23.30</div>
                                    <div class="libr_2" style="display: none">￥33.80</div>
                                    <div class="libr_3" style="display: none">折扣：69折</div>
                                    <div class="libr_4">
                                    	<a id="${boo.id }" rel="putBoo">
                                    		<img src="/public/indexFile/images/list_07.gif"/></a></div>
                                    <div class="libr_4">
                                    	<a id="${boo.id }" rel="chBoo">
                                    		<img src="/public/indexFile/images/list_08.gif"/></a></div>
                                </div>
                            </div>
                        </li>
                        #{/list }
                    </ul>
                </div>
                <!--分页-->
                <div class="lt_c3">
                	<div class="ltb3_y">
                        <div class="ltb_1"><a href="cp=1"><img src="/public/indexFile/images/list_12.gif"/></a></div>
                        <div class="ltb_2"><a href=""><img src="/public/indexFile/images/list_13.gif"/></a></div>
                        <div class="ltb_3">
                            <ul id="page_li">
                            </ul>
                        </div>
                        <div class="ltb_4"><a href=""><img src="/public/indexFile/images/list_14.gif"/></a></div>
                        <div class="ltb_5"><a href="cp=${pc }#"><img src="/public/indexFile/images/list_15.gif"/></a></div>
                        <div class="ltb_6"><input type="text"/></div>
                        <div class="ltb_7"><a href="#"><img src="/public/indexFile/images/list_11.gif"/></a></div>
                	</div>
                </div>
                <script type="text/javascript">
                	var cp = ${cp};
                	var pc = ${pc};
                	var size = ${count };
                	var j = 0;
                	for(var i = (cp*10-10) ; j < 10 && i < pc; i++){
                		$("#page_li").append('<li '+ (i+1 == cp ? "style='background:red;color:#fff'" : "") +'>'+(i+1)+'</li>');
                		j++;
                	}
                </script>
               
            </div>
            
            <!-- 四 -->
            <div class="cn_a_r3">
                <div class="cnr_a">
                    <div class="cnr_a1"><samp>热评读书</samp><samp class="cnr_sa">YUAPINGTUSHU</samp></div>
                    <div class="cnr_a2"><a href="#"><img src="/public/indexFile/images/images_38.gif"/></a></div>
                </div>
                <div class="cnr_b">
                    <ul>
                        #{list service.BookService.getHootTui(6),as:'rpBook'}
                        <li>
                            <div class="cna_1"><a href="/show_${rpBook.id}_book.html"><img src="${rpBook.simage}"/></a></div>
                            <div class="cna_2">
                                <div class="ca_2_1"><a href="#">${rpBook.booName}</a></div>
                                <div class="ca_2_2">${rpBook.booDet}</div>
                            </div>
                        </li>
                        #{/list}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- content 结束-->
    #{set mb:service.MemberService.ckLogin(session) /}
    <script type="text/javascript">
    	$("#pf").mousemove(function(e){
    		var x = e.clientX;
    		//以下进行测试
	        if (Sys.firefox) x=x-0.5;
			var l = this.getBoundingClientRect().left;
    		$("#df").width(x-l-1);
    		var df = (x-l)/(60/5)+"";
    		
    		var ind = df.indexOf(".");
			if(df.length > ind+2){
				df = df.substring(0,ind+2);
			}
    		$("#df_d").text(df+"分");
    	});
    	var islog = "#{get 'mb' /}";
    	
    	$("a[rel='putBoo']").click(function(e){
    		if(islog == ""){
    			aduAlert("你还未登录,请先登录!","提示",function(e){
    				window.location = "/login.html";
    			});
    		}else{
	    		var id = this.id;
	    		$.ajax({
	    			url:'/controllers/Order.addBook',
	    			type:'post',
	    			data:'booid='+id,
	    			success:function(e){
	    				if(e != ""){
	    					aduAlert('你借阅书籍已经达到了当前借阅等级的上限,前去充值,提升自己的等级!','提示',function(e){
	    						window.location='/controllers/MemberView.paymoney'
	    					});
	    				}else{
		    				aduConfirm("加入成功","提示",function(fag){
								if(!fag){
									window.open("/controllers/Order.showCar");
								}
							},{
								okBut:'继续借阅',
								cancelBut:'查看'
							});
						}
	    			}
	    		});
    		}
    		return false;
    	});
    	
    	
    	$("a[rel='chBoo']").click(function(e){
    		if(islog == ""){
    			aduAlert("你还未登录,请先登录!","提示",function(e){
    				window.location = "/login.html";
    			});
    		}else{
	    		var id = this.id;
	    		$.ajax({
	    			url:'/controllers/Order.scBook',
	    			type:'post',
	    			data:'booid='+id,
	    			success:function(e){
	    				aduAlert(e,"提示");
	    			}
	    		});
    		}
    		return false;
    	});
    	
    </script>
